<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/template/template_layout_lrt.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<style>
.ui-button, .ui-button span, button.ui-button.ui-state-default span,
	.ui-button.ui-state-default span {
	font-weight: normal
}
</style>
	</ui:define>
	<ui:define name="top-box-tools">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<h:form id="btnForm">
			<p:growl id="msgs" showDetail="true" />
			<p:toolbar id="btnBar" >
			
			<!--<p:toolbar id="btnBar"  rendered="#{s:hasPermission(session,'xtsz_xtqx_zzjg_xjbm') or
			s:hasPermission(session,'xtsz_xtqx_zzjg_xzyg') or 
			s:hasPermission(session,'xtsz_xtqx_zzjg_bjbm') or 
			s:hasPermission(session,'xtsz_xtqx_zzjg_bjyg') or 
			s:hasPermission(session,'xtsz_xtqx_zzjg_sc')}"> -->
			
			
				<f:facet name="left">
					<p:commandButton icon="fa fa-plus" value="新建" style="margin-right:10px"
						oncomplete="PF('createDialog').show()"
						update=":leftForm:tree"
						actionListener="#{standardLibController.preCreate()}" />
					<p:commandButton icon="fa fa-pencil" value="编辑" style="margin-right:10px"
						disabled="#{standardLibController.selected != null}" 
						update=":leftForm:tree"
						oncomplete="PF('createDialog').show()" 
						/>
					<p:commandButton icon="fa fa-trash-o" 
						value="删除" 
						style="margin-right:10px"
						disabled="#{standardLibController.selected ==null}"
						update=":leftForm:tree"
						actionListener="#{standardLibController.delete()}">
						<p:confirm header="提示" message="确定删除选中的记录吗?" icon="ui-icon-alert" />
					</p:commandButton>
				</f:facet>
			</p:toolbar>
		</h:form>
	</ui:define>
	<ui:define name="left-box-title" style="border:0">
		标准检查项目
	</ui:define>
	<ui:define name="left-box-body">
		<h:form id="leftForm">
			<p:panel style="border:0;width:98%">
				<p:tree value="#{standardLibController.root}" var="node" dynamic="true"
					id="tree" widgetVar="tree" animate="true" selectionMode="single" style="border:0">
					<p:ajax event="expand" update="tree" listener="#{standardLibController.onNodeExpand}" />
					<p:ajax event="select" listener="#{standardLibController.onNodeSelect}"
						update="" />
					<p:treeNode type="ROOTNAME" icon="fa fa-home">
						<h:outputText value="#{node}" />
					</p:treeNode>
					<p:treeNode type="INSPECTIONPROJECT" icon="fa fa-user">
						<h:outputText value="#{node}" />
					</p:treeNode>
				</p:tree>
			</p:panel>
		</h:form>
	</ui:define>
	<ui:define name="right-box-title">
		标准项目列表
	</ui:define>
	<ui:define name="right-box-body">
		<h:form id="rightForm">
			<p:dataTable var="pebCurrent" id="plist" value="#{standardLibController.selectLists}" rowKey="#{pebCurrent.id}"
				widgetVar="plist" emptyMessage="无记录" style="text-align:center">
				<p:column headerText="序号" style="width:20%">
					<h:outputText value="#{pebCurrent.code}" />
				</p:column>
				<p:column headerText="评价项目" style="width:10%">
					<h:outputText value="#{pebCurrent.name}" />
				</p:column>
				<p:column headerText="检查要素及要求" style="width:10%">
					<h:outputText rendered="#{pebCurrent.locked}" style="color:red" value="锁定" />
					<h:outputText rendered="#{!pebCurrent.locked}" value="正常" />
				</p:column>
				<p:column headerText="评分标准" style="width:15%">
					<h:outputText value="#{pebCurrent.telephone}" />
				</p:column>
				<p:column headerText="检查参照依据" style="width:20%">
					<h:outputText value="#{pebCurrent.address}" />
				</p:column>
			</p:dataTable>
		</h:form>
		<!-- 编辑员工 -->
		<p:dialog widgetVar="editDialog"  id="editDialog" header="编辑员工信息" closable="false"
			resizable="false" draggable="false" modal="true" width="430"
			height="350">
			<h:form id="editform">
				<p:toolbar id="editPersonToBar">
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" id="saveEditPerBtn"
							update=":leftForm:tree :btnForm:btnBar  :btnForm:msgs :rightForm:plist"
							oncomplete="PF('editDialog').hide()"
							actionListener="#{standardLibController.update()}" />
						<p:commandButton icon="ui-icon-cancel" value="取消" type="button"
							onclick="PF('editDialog').hide()" style="margin-left:5px" />
					</f:facet>
				</p:toolbar>
				<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
				<p:message for="newName" display="text" />
				<p:panelGrid id="editInfopg" columns="2" cellpadding="4"
					style="width:100%;text-align:center">
					<h:outputText value="编号:" />
					<p:inputText value="#{standardLibController.selected.nodeNo}" id="newName">
					</p:inputText>
					<h:outputText value="名称:" />
					<p:inputText value="#{standardLibController.selected.name}" id="newName">
					</p:inputText>
					<h:outputText value="类型" />
					<p:inputText value="#{standardLibController.selected.itemType}" id="ownGroup" onclick="PF('deptDialog').show()" />
					<h:outputText value="内容" />
					<p:inputText value="#{standardLibController.selected.content}" />
					<h:outputText value="显示顺序:" />
					<p:inputText value="#{standardLibController.selected.nodeOrder}" id="newName">
					</p:inputText>
				</p:panelGrid>
			</h:form>
		</p:dialog>
		
		<p:dialog widgetVar="createDialog" id="createDialog" header="部门信息" closable="false"
			resizable="false" draggable="false" modal="true" width="350" height="350">
			<h:form id="cgform">
				<p:toolbar id="createDeptToBar">
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" id="saveDeptBtn"
							update=":leftForm:tree :btnForm:btnBar :btnForm:msgs :rightForm:plist"
							oncomplete="PF('createDialog').hide()" actionListener="#{standardLibController.create()}"
							style="margin-left:10px" />
						<p:commandButton icon="ui-icon-cancel" value="取消" type="button" onclick="PF('createDialog').hide()" />
					</f:facet>
				</p:toolbar>
				<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
				<p:message for="deptName" display="text" />
				<p:panelGrid id="editInfopg" columns="2" cellpadding="4"
					style="width:100%;text-align:center">
					<h:outputText value="编号:" />
					<p:inputText value="#{standardLibController.createObj.nodeNo}" id="newName">
					</p:inputText>
					<h:outputText value="名称:" />
					<p:inputText value="#{standardLibController.createObj.name}" id="newName">
					</p:inputText>
					<h:outputText value="类型" />
					<p:inputText value="#{standardLibController.createObj.itemType}" id="ownGroup" onclick="PF('deptDialog').show()" />
					<h:outputText value="内容" />
					<p:inputText value="#{standardLibController.createObj.content}" />
					<h:outputText value="显示顺序:" />
					<p:inputText value="#{standardLibController.createObj.nodeOrder}" id="newName">
					</p:inputText>
				</p:panelGrid>
			</h:form>
		</p:dialog>
	</ui:define>
</ui:composition>
